using System;

namespace Tickets.Model
{

	[Serializable]
	public enum TicketState
	{
		New, Accepted, Rejected, Assigned, Closed
	}

	[Serializable]
	public enum TicketResolution
	{
		Unresolved, Resolved, Rejected
	}

	[Serializable]
	public class Ticket
	{

		private int id = default( int );
		private Project project;
		private string code;
		private string text;
		private TicketState state;
		// FEO
		private Guid workflowInstanceId;

		protected Ticket()
		{
		}

		public Ticket( Project project, string code, string text )
		{
			//id = project.GetTicketsSortedByCode().Length + 1;
			this.project = project;
			Code = code;
			Text = text;
			state = TicketState.New;
		}

		public int Id
		{
			get { return id; }
		}

		public Project Project
		{
			get { return project; }
		}

		public string Code
		{
			get { return code; }
			set { code = value; }
		}

		public string Text
		{
			get { return text; }
			set { text = value; }
		}

		public TicketState State
		{
			get { return state; }
			set { state = value; }
		}

		public Guid WorkflowInstanceId
		{
			get { return workflowInstanceId; }
			set { workflowInstanceId = value; }
		}

	}
}
